#!/bin/bash

declare p
declare ip
declare list
declare local
declare c
declare -i id
declare -i start
declare -ir batch=30000

if [ -z $1 ]; then
  start=0 
else
  start=$1
fi

  list=`${SVT_SCALE}/bin/clientlist`

  id=${start}
  for ip in ${list}
  do
    printf -v c "/niagara/test/scale/dovehicles %d" ${id}
    echo ssh $ip "$c"
    id=${id}+${batch}
  done

  read -p "Continue (y/n)? " cont
  echo

  if [[ ("${cont}" == "y")||("${cont}" == "Y") ]]
  then
    id=${start}
    for ip in ${list}
    do
      printf -v c "/niagara/test/scale/dovehicles %d" ${id}
      echo ssh -nx $ip \"$c\"
      ssh -nx $ip "$c" &
      id=${id}+${batch}
    done
  fi

